package com.xb.cloud.order.model.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.xb.cloud.common.client.bo.UpdateInfo;
import com.xb.cloud.order.model.ProductStock;
import com.xb.cloud.order.model.ProductStockExample;

public interface ProductStockMapper {
    int countByExample(ProductStockExample example);

    int deleteByExample(ProductStockExample example);

    int deleteByPrimaryKey(Long id);

    int insert(ProductStock record);

    int insertSelective(ProductStock record);

    List<ProductStock> selectByExample(ProductStockExample example);

    ProductStock selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") ProductStock record, @Param("example") ProductStockExample example);

    int updateByExample(@Param("record") ProductStock record, @Param("example") ProductStockExample example);

    int updateByPrimaryKeySelective(ProductStock record);

    int updateByPrimaryKey(ProductStock record);
    
    int updateSkuStock(ProductStock record);
    

	/**
	 * 锁定查询的行
	 * @param productStockExample
	 * @return
	 */
	List<ProductStock> selectByExampleForUpdate(ProductStockExample productStockExample);
	
	/**
	 * 根据id 批量更新库存数据
	 * @param list
	 * @return
	 */
	int updateBatch(@Param("list") List<ProductStock> list , @Param("updateInfo") UpdateInfo updateInfo);

	int updateStockBatch4CancelOrder(@Param("list") List<ProductStock> productStockList,  @Param("updateInfo") UpdateInfo updateInfo);
}